#ifndef DESCR_PARSER_H
#define DESCR_PARSER_H


#include <string>
#include "climate.h"
#include "ground_type.h"


class DescrParser
{
public:
	bool open(std::string filepath);
	void setBasePath(std::string path);

protected:
	virtual bool parse(std::string line) = 0;
	std::string  popNextToken(std::string& str);
	std::string  popNextToken(std::string& str, const std::string& delimiters);

	static const std::string DELIMITERS;
	static const std::string COMMA;

	std::string basePath;
};


class GroundTypesParser : public DescrParser
{
protected:
	bool parse(std::string line);

private:
	std::shared_ptr<Climate> parsingClimate;
};


class ClimatesParser : public DescrParser
{
protected:	
	bool parse(std::string line);	

private:

	std::shared_ptr<Climate> parsingClimate;
};


#endif